package com.wsoft.system.service.impl;

import cn.hutool.core.convert.Convert;
import com.wsoft.core.service.CommonLevelService;
import com.wsoft.system.entity.SysLevelEntity;
import com.wsoft.system.service.ISysLevelService;
import com.wsoft.core.vo.LevelVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author z001
 * @Date 2024/12/31 13:22
 */
@Service
public class CommonLevelServiceImpl implements CommonLevelService {

    @Resource
    private ISysLevelService levelService;

    @Override
    public List<LevelVO> getLevelAll() {
        List<SysLevelEntity> list = levelService.listAll();
        return list.stream().map(item -> Convert.convert(LevelVO.class,item)).collect(Collectors.toList());
    }
}
